﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;

namespace Wolfut.MirageEE.Domain.Procurement
{
    /// <summary>
    /// 销售退货信息
    /// </summary>
    /// <remarks>
    /// Author: Leo
    /// Date: 2009-03-14
    /// </remarks>
    [ActiveRecord("SALES_RETURN_INFOS")]
    public class SOGoodsReturnOrder : PersistentObjectWithGuid
    {
        #region 客户ID
        private string customerID = string.Empty;
        [Property("CUSTOMER_ID")]
        [ValidateNonEmpty, ValidateLength(0, 40, "客户ID超长")]
        public virtual string CustomerID
        {
            get { return customerID; }
            set { customerID = value; }
        }
        #endregion

        #region 销售单ID
        private string salesBillID = string.Empty;
        [Property("SALES_BILL_ID")]
        [ValidateNonEmpty, ValidateLength(0, 40, "销售单ID超长")]
        public virtual string SalesBillID
        {
            get { return salesBillID; }
            set { salesBillID = value; }
        }
        #endregion

        #region 退货编号
        private string _SALES_RETURN_CODE = string.Empty;
        [Property("SALES_RETURN_CODE")]
        [ValidateIsUniqueInSameTransactionWithString(false, "数据库已经存在相同的退货编号！")]
        [ValidateNonEmpty, ValidateLength(0, 100, "退货编号超长")]
        public virtual string SALES_RETURN_CODE
        {
            get { return _SALES_RETURN_CODE; }
            set { _SALES_RETURN_CODE = value; }
        }
        #endregion

        #region 日期
        private DateTime salesReturnDate = DateTime.Now;
        [Property("SALES_RETURN_DATE")]
        public virtual DateTime SalesReturnDate
        {
            get { return salesReturnDate; }
            set { salesReturnDate = value; }
        }
        #endregion

        #region 项目ID
        private string projectID = string.Empty;
        [Property("PROJECT_ID")]
        [ValidateNonEmpty, ValidateLength(0, 40, "项目ID超长")]
        public virtual string ProjectID
        {
            get { return projectID; }
            set { projectID = value; }
        }
        #endregion

        #region 币别代码
        private string currencyCode = string.Empty;
        [Property("CURRENCY_CODE")]
        [ValidateNonEmpty, ValidateLength(0, 20, "币别代码超长")]
        public virtual string CurrencyCode
        {
            get { return currencyCode; }
            set { currencyCode = value; }
        }
        #endregion

        #region 送货地址
        private string deliveryAddress = string.Empty;
        [Property("DELIVERY_ADDRESS")]
        [ValidateNonEmpty, ValidateLength(0, 100, "送货地址超长")]
        public virtual string DeliveryAddress
        {
            get { return deliveryAddress; }
            set { deliveryAddress = value; }
        }
        #endregion

        #region 送货日期
        private DateTime deliveryDate = DateTime.Now;
        [Property("DELIVERY_DATE")]
        public virtual DateTime DeliveryDate
        {
            get { return deliveryDate; }
            set { deliveryDate = value; }
        }
        #endregion

        #region 销售人员
        private string salesMan = string.Empty;
        [Property("SALESMAN")]
        [ValidateNonEmpty, ValidateLength(0, 100, "销售人员内容超长")]
        public virtual string SalesMan
        {
            get { return salesMan; }
            set { salesMan = value; }
        }
        #endregion

        #region 送货单号
        private string deliveryBillCode = string.Empty;
        [Property("DELIVERY_BILL_CODE")]
        [ValidateNonEmpty, ValidateLength(0, 100, "送货单号超长")]
        public virtual string DeliveryBillCode
        {
            get { return deliveryBillCode; }
            set { deliveryBillCode = value; }
        }
        #endregion

        #region 客户订单号（销售单号）
        private string customerOrderCode = string.Empty;
        [Property("CUSTOMER_ORDER_CODE")]
        [ValidateNonEmpty, ValidateLength(0, 100, "客户订单号（销售单号）超长")]
        public virtual string CustomerOrderCode
        {
            get { return customerOrderCode; }
            set { customerOrderCode = value; }
        }
        #endregion

        #region 发票编号
        private string invoiceCode = string.Empty;
        [Property("INVOICE_CODE")]
        [ValidateNonEmpty, ValidateLength(0, 100, "发票编号超长")]
        public virtual string InvoiceCode
        {
            get { return invoiceCode; }
            set { invoiceCode = value; }
        }
        #endregion

        #region 备注
        private string remarks = string.Empty;
        [Property("REMARKS")]
        [ValidateNonEmpty, ValidateLength(0, 2000, "备注超长")]
        public virtual string Remarks
        {
            get { return remarks; }
            set { remarks = value; }
        }
        #endregion

        #region 账期
        private short collectionPeriod;
        [Property("COLLECTION_PERIOD")]
        public virtual short CollectionPeriod
        {
            get { return collectionPeriod; }
            set { collectionPeriod = value; }
        }
        #endregion

        #region 退货折扣率
        private decimal salesReturnDiscountRate;
        [Property("SALES_RETURN_DISCOUNT_RATE")]
        public virtual decimal SalesReturnDiscountRate
        {
            get { return salesReturnDiscountRate; }
            set { salesReturnDiscountRate = value; }
        }
        #endregion

        #region 收款方式
        private string collectionBillMode = string.Empty;
        [Property("COLLECTING_BILL_MODE")]
        [ValidateNonEmpty, ValidateLength(0, 100, "收款方式超长")]
        public virtual string CollectionBillMode
        {
            get { return collectionBillMode; }
            set { collectionBillMode = value; }
        }
        #endregion

        #region 收款条件
        private string collectionBillCondition = string.Empty;
        [Property("COLLECTING_BILL_CONDITION")]
        [ValidateNonEmpty, ValidateLength(0, 100, "收款条件内容超长")]
        public virtual string CollectionBillCondition
        {
            get { return collectionBillCondition; }
            set { collectionBillCondition = value; }
        }
        #endregion

        #region 接收退款的账户
        private string refundmentAccount = string.Empty;
        [Property("REFUNDMENT_ACCOUNT")]
        [ValidateNonEmpty, ValidateLength(0, 100, "接收退款的账户内容超长")]
        public virtual string RefundmentAccount
        {
            get { return refundmentAccount; }
            set { refundmentAccount = value; }
        }
        #endregion

        #region 本次退款
        private decimal currentRefundment;
        [Property("CURRENT_REFUNDMENT")]
        public virtual decimal CurrentRefundment
        {
            get { return currentRefundment; }
            set { currentRefundment = value; }
        }
        #endregion

        #region 退款状态
        private short refundmentState;
        [Property("REFUNDMENT_STATE")]
        public virtual short RefundmentState
        {
            get { return refundmentState; }
            set { refundmentState = value; }
        }
        #endregion

        #region 制单人
        private string producerBy = string.Empty;
        [Property("PRODUCER_BY")]
        [ValidateNonEmpty, ValidateLength(0, 40, "制单人超长")]
        public virtual string ProducerBy
        {
            get { return producerBy; }
            set { producerBy = value; }
        }
        #endregion

        #region 凭证号
        private string voucherNumber = string.Empty;
        [Property("VOUCHER_NUMBER")]
        [ValidateNonEmpty, ValidateLength(0, 100, "凭证号超长")]
        public virtual string VoucherNumber
        {
            get { return voucherNumber; }
            set { voucherNumber = value; }
        }
        #endregion

        #region 是否删除
        private bool isDeleted;
        [Property("IS_DELETED")]
        [ValidateNonEmpty]
        public virtual bool IsDeleted
        {
            get { return isDeleted; }
            set { isDeleted = value; }
        }
        #endregion

    }
}
